﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

namespace WebBanHang
{
    public class DNGH
    {
        string _tenDangNhap, _matKhau;

        public string MatKhau
        {
            get { return _matKhau; }
            set { _matKhau = value; }
        }

        public string TenDangNhap
        {
            get { return _tenDangNhap; }
            set { _tenDangNhap = value; }
        } 
        public DNGH(string tenDN, string MKhau)
        {
            _tenDangNhap = tenDN;
            _matKhau = MKhau;
        }
        public bool IsValidLogin()
        {
            string sql = "select * from DOANHNGHIEP where USERNAME='" + _tenDangNhap.Replace("'", "'") + "' and PASSWORD='" + _matKhau.Replace("'", "'") + "'";
            using (DataTable dt = DataProvider.LoadTable(sql))
            {
                bool ret = dt.Rows.Count > 0;
                return ret;
            }
        }
    }
}